<?php

namespace App\Admin\Actions\ShopUser;

use App\Library\Logic\OperateLogLogic;
use App\Library\Logic\ShopUserLogic;
use App\Library\Service\UserService;
use App\Models\ShopUserModel;
use Encore\Admin\Actions\Response;
use Encore\Admin\Actions\RowAction;
use Encore\Admin\Facades\Admin;

class ShopUserRefreshAction extends RowAction
{
    public $name = '刷新';

    /**
     * handle
     * @param ShopUserModel $model
     * @return Response
     */
    public function handle(ShopUserModel $model): Response
    {
        $userService = new UserService(new ShopUserLogic);
        $userService->cache($model->user_id);
        return $this->response()->success('操作成功');
    }
}
